package com.nuc.crp4;

/**
 * Time    : 2023/3/23 22:03
 * Author  : 王摇摆
 * FileName: Main1.java
 * Software: IntelliJ IDEA 2020.2.2
 * Blog    ：https://blog.csdn.net/weixin_44943389?type=blog
 */

/**
 * 接口关心有没有
 * 继承关心是不是
 * 应该将鸭子都具有的功能设置为抽象类
 * 可有可无的方法写为接口类
 */
public class Main4 {
    public static void main(String[] args) {
        MallarDuck mallarDuck = new MallarDuck("MallarDuck");
        mallarDuck.display();
        mallarDuck.quack();
        mallarDuck.swim();
        mallarDuck.fly();
        System.out.println("--------------------------");

        RedaheadDuck redaheadDuck = new RedaheadDuck("RedaheadDuck");
        redaheadDuck.display();
        redaheadDuck.quack();
        redaheadDuck.swim();
        redaheadDuck.fly();
        System.out.println("--------------------------");

        RubberDuck rubberDuck = new RubberDuck("RubberDuck");
        rubberDuck.display();
        rubberDuck.quack();
        rubberDuck.swim();
        System.out.println("--------------------------");

        DecoyDuck decoyDuck = new DecoyDuck("DecoyDuck");
        decoyDuck.display();
        decoyDuck.swim();



    }
}
